package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.area.CreateAreaBo;
import com.zhuss.bean.bo.core.area.DeleteAreaBo;
import com.zhuss.bean.bo.core.area.UpdateAreaBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.core.area.AreaOperateServiceExt;
import com.zhuss.exception.OceanException;


/**
 * @description: 地域操作的Controller
 * @author: zhushanshuo
 * @create: Thu Apr 08 20:24:46 CST 2021
 **/
@RestController
@RequestMapping("/area")
public class AreaOperateController extends BaseController {
	
	@Autowired
	@Qualifier("areaOperateService")
	private OperateService<Void, Object> areaOperateService;
	
	@Autowired
	@Qualifier("areaOperateServiceExt")
	private AreaOperateServiceExt areaOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws OceanException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateAreaBo bo) throws OceanException {
		
		areaOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws OceanException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateAreaBo bo) throws OceanException {
		
		areaOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws OceanException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteAreaBo bo) throws OceanException {
		
		areaOperateService.delete(bo);
    }
	
}
